<template>
  <div class="components-container">
    <div>
      <el-form :label-position="labelPosition" label-width="80px" :model="form">
        <el-form-item label="标题">
          <el-input v-model="form.title"></el-input>
        </el-form-item>
        <el-form-item label="公告主体内容">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
      </el-form>
    </div>

    <div class="editor-container">
      <el-tag class="tag-title"> 规则 </el-tag>
      <!-- <el-alert
        :closable="false"
        title="You can change the language of the admin system to see the effect"
        type="success"
      /> -->
      <markdown-editor ref="markdownEditor" @changeMsg="getHtml" />
    </div>

    <!-- <div v-html="html" /> -->
  </div>
</template>

<script>
import MarkdownEditor from "@/components/MarkdownEditor";

export default {
  name: "MarkdownDemo",
  components: { MarkdownEditor },
  data() {
    return {
      form: {
        id: 3,
        title: "新公告",
        name: "公告主体内容",
        content: "~",
        adminId: 1,
        creator: 1,
      },
    };
  },
  computed: {},
  methods: {
    getHtml(e) {
      console.log(e);
    },
   
  },
  created() {
    console.log(this.$route.query)
    let value=JSON.parse(this.$route.query.value)
    console.log(value)
     this.form= value;
  }
};
</script>

<style scoped>
.editor-container {
  margin-bottom: 30px;
}
.tag-title {
  margin-bottom: 5px;
}
</style>
